﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameLib.Utils;
using System.Collections;

namespace GameLib
{
	public class ContentDictionary : Dictionary<Name, Content> //IEnumerable<KeyValuePair<Name, Content>>, IEnumerable
	{
		/*
		public void Add(Name key, Content value)
		{
			this[key] = value;
		}

		public bool ContainsKey(Name key)
		{
			return m_ContentDict.ContainsKey(key);
		}

		public ICollection<Name> Keys
		{
			get { return m_ContentDict.Keys; }
		}

		public bool Remove(Name key)
		{
			return m_ContentDict.Remove(key);
		}

		public bool TryGetValue(Name key, out Content value)
		{
			return m_ContentDict.TryGetValue(key, out value);
		}

		public ICollection<Content> Values
		{
			get { return m_ContentDict.Values; }
		}

		private Content this[Name key]
		{
			get
			{
				Content ret = null;
				TryGetValue(key, out ret);
				return ret;
			}
			set
			{
				m_ContentDict[key] = value;
			}
		}*/

		public ContentType Get<ContentType>(Name key) where ContentType : Content
		{
			Content foundContent;
			if (TryGetValue(key, out foundContent))
				return foundContent as ContentType;

			return null;
		}

		/*
		public void Set(Name key, Content resource)
		{
			this[key] = resource;
		}

		public void Clear()
		{
			m_ContentDict.Clear();
		}

		public int Count
		{
			get { return m_ContentDict.Count; }
		}

		public IEnumerator<KeyValuePair<Name, Content>> GetEnumerator()
		{
			return m_ContentDict.GetEnumerator();
		}

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		private Dictionary<Name, Content> m_ContentDict = new Dictionary<Name, Content>();
		*/
	}
}
